<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获得数据库名</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.pg-dbname" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">pg_dbname</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">pg_dbname</span> &mdash; <span class="dc-title">获得数据库名</span></p>

   </div>
   <div class="refsect1 unknown-unknown-seealsq" id="refsect1-function.pg-dbname-unknown-unknown-seealsq">
    <h3 class="title">说明</h3>
    <div class="methodsynopsis dc-description">
     <span class="methodname"><strong>pg_dbname</strong></span>
      ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$connection</code></span>
     ) : <span class="type">string</span></div>

    <p class="para rdfs-comment">
     <span class="function"><strong>pg_dbname()</strong></span> 返回给定 PostgreSQL
     <code class="parameter">connection</code> 资源的数据库名称。如果
     <code class="parameter">connection</code> 不是有效的 PostgreSQL 连接资源则返回 <strong><code>FALSE</code></strong>。
    </p>
    <p class="para">
     <div class="example" id="example-2481">
      <p><strong>Example #1 <span class="function"><strong>pg_dbname()</strong></span> 例子</strong></p>
      <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;error_reporting</span><span style="color: #007700">(</span><span style="color: #0000BB">E_ALL</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"host=localhost&nbsp;port=5432&nbsp;dbname=mary"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">pg_dbname</span><span style="color: #007700">();&nbsp;</span><span style="color: #FF8000">//&nbsp;mary<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
      </div>

     </div>
    </p>
   </div>

  </div></div></div></body></html>